README for "Education and Social Capital"
Apfeld, Coman, Gerring and Jessee
Journal of Experimental Political Science


The results presented in the paper are based on four different datasets:
- the scores on the Romanian baccalaureate examination between 2004 and 2019 (bac_scores.Rdata)
- a survey of Romanians conducted by the authors (JEPS-replication-data.RData)
- contains relevant variables from World Values Survey (WVS) wave 6 (WV6_short_JEPS.dta)
- the Barro-Lee Educational Attainment Dataset (no dataset file, instead read from website directly in code)

Three of these datasets (with some modifications to ensure anonymity, none of which affects the results of the paper) are included here. The fourth (Barro-Lee) is downloaded directly through the replication code. To reproduce the paper's results, you should ensure that all datasets as well as the four code files are all downloaded to the same directory before running the code. Also note that some packages (described at the top of the respective code files) must be installed before running the code.

Below is a description of the code files and what results they produce:

"figure_1_2.R"
R code that reproduces all results based on the Bac test results. This includes Figure 1 and Figure 2 in the main text. Note that "rdplotdensity_two_lines.R" provides a modified plotting function required to produce Figure 2 and this file should be downloaded in the same directory as other code files (formally, it must be in R's working directory when "figure_1_2.R" is run in order to produce the figure). Requires data file "bac_scores.Rdata"

"JEPS-social-capital-replication.R"
R code that reproduces all results based on the survey of Romanians used for the regression discontinuity analyses in the paper. This includes from the main paper: 
Figure 3, Table 1, Figure 4, Figure 5, Table 2, Figure 6, Table 3 
And from the appendix: Table B1, Figure C1, Figure C2, Figure C3, Table C1, Figure C4, Table C2, Table C3, Table C4
Requires data file "JEPS-replication-data.RData)"

"reproduce_figures7_D1_JEPS.do"
Stata code that reproduces Figure 7 from the paper using the World Values Survey (wave 6). Requires data file "WV6_short.dta"

"figure_f1.R"
R code that reproduces figure F1 in the Appendix. This script automatically downloads the Barro-Lee dataset used to plot the percentage of the population of each country with partial or complete tertiary education.
